@extends('frontend/layouts/flaty_to_bootstrap')

@section('content.titley')
PurchaseCar Management ::
@parent
@stop

@section('content.breadcrumb.inner')
    <li><a href="{{  route('home') }}"><i class="icon-home"></i> Dashboard</a><span class="divider"><i class="icon-angle-right"></i></span></li>
    <li class="active">PurchaseCar list</li>
@stop

@section('content.main')

<p>{{ link_to_route('car_balance.purchase_car.create', 'Add new PurchaseCar', null, array('class' => 'btn btn-info')) }}</p>

    <!--{{ link_to_route('car_balance.purchase_car.index', 'Include Deleted PurchaseCar', array('withTrashed' => 'true'), array('class' => 'btn btn-medium')) }}
    {{ link_to_route('car_balance.purchase_car.index', 'Show Only Deleted PurchaseCar', array('onlyTrashed' => 'true'), array('class' => 'btn btn-medium')) }}-->

{{  $purchase_cars->links() }}

<table class="table table-bordered table-striped table-hover">
    <thead>
    <tr>
                <th>Id</th>
                <th>Purchase Date</th>
                <th>Car Maker</th>
                <th>Car Type</th>
                <th>Model Year</th>
                <th>Chasis Number</th>
                <th>Color</th>
                <th>Number Plate Flag</th>
                <th>Purchase Price</th>
                <th>Purchase Price Fixed</th>
                <th>Consumption Tax</th>
                <th>Recycle Fee</th>
                <th>Car Certification</th>
                <th>Auction Comission</th>
                <th>Transport Fee Japan</th>
                <th>Transport Fee Japan Fxd</th>
                <th>Nmh Commision</th>
                <th>Tic June Flag</th>
                <th>Exhibit Number</th>
                <th>Burtgel Solih</th>
                <th>Export Erasure</th>
                <th>Car Tax Cancel</th>
                <th>Send Export Erasure To Transport Company</th>
                <th>Fax Export Erasure To Auction</th>
                <th>Mail Export Erasure To Nmc</th>
                <th>Car Liability Insurance Cancel</th>
                <th>Recycle</th>
                <th>Comment</th>
                <th>Cancel Flag</th>
                <th>Cancel Fee</th>
                <th>Re Auction Flag</th>
                <th>Auction Penalty</th>
                        <th>Customer</th>                <th>Vanning Company Branch</th>                <th>Car Auction</th>                <th>Service Company</th>
        <th class="span2">Actions</th>
    </tr>
    </thead>
    <tbody>
    @foreach ($purchase_cars as $purchase_car)
    <tr>
        <td>{{  link_to_route('car_balance.purchase_car.show', $purchase_car->id, array($purchase_car->id), array()) }}</td>
        <td>{{  $purchase_car->purchase_date }}</td>
        <td>{{  $purchase_car->car_maker }}</td>
        <td>{{  $purchase_car->car_type }}</td>
        <td>{{  $purchase_car->model_year }}</td>
        <td>{{  $purchase_car->chasis_number }}</td>
        <td>{{  $purchase_car->color }}</td>
        <td>{{  $purchase_car->number_plate_flag }}</td>
        <td>{{  $purchase_car->purchase_price }}</td>
        <td>{{  $purchase_car->purchase_price_fixed }}</td>
        <td>{{  $purchase_car->consumption_tax }}</td>
        <td>{{  $purchase_car->recycle_fee }}</td>
        <td>{{  $purchase_car->car_certification }}</td>
        <td>{{  $purchase_car->auction_comission }}</td>
        <td>{{  $purchase_car->transport_fee_japan }}</td>
        <td>{{  $purchase_car->transport_fee_japan_fxd }}</td>
        <td>{{  $purchase_car->nmh_commision }}</td>
        <td>{{  $purchase_car->tic_june_flag }}</td>
        <td>{{  $purchase_car->exhibit_number }}</td>
        <td>{{  $purchase_car->burtgel_solih }}</td>
        <td>{{  $purchase_car->export_erasure }}</td>
        <td>{{  $purchase_car->car_tax_cancel }}</td>
        <td>{{  $purchase_car->send_export_erasure_to_transport_company }}</td>
        <td>{{  $purchase_car->fax_export_erasure_to_auction }}</td>
        <td>{{  $purchase_car->mail_export_erasure_to_nmc }}</td>
        <td>{{  $purchase_car->car_liability_insurance_cancel }}</td>
        <td>{{  $purchase_car->recycle }}</td>
        <td>{{  $purchase_car->comment }}</td>
        <td>{{  $purchase_car->cancel_flag }}</td>
        <td>{{  $purchase_car->cancel_fee }}</td>
        <td>{{  $purchase_car->re_auction_flag }}</td>
        <td>{{  $purchase_car->auction_penalty }}</td>

        <td>{{  $purchase_car->customer()->first() ? link_to_route('car_balance.customer.show', $purchase_car->customer()->first()->name, array('id' => $purchase_car->customer()->first()->id), array()) : 'NULL' }}</td>
        <td>{{  $purchase_car->vanningCompany()->first() ? link_to_route('car_balance.vanning_company_branch.show', $purchase_car->vanningCompany()->first()->name, array('id' => $purchase_car->vanningCompany()->first()->id), array()) : 'NULL' }}</td>
        <td>{{  $purchase_car->carAuction()->first() ? link_to_route('car_balance.car_auction.show', $purchase_car->carAuction()->first()->name, array('id' => $purchase_car->carAuction()->first()->id), array()) : 'NULL' }}</td>
        <td>{{  $purchase_car->serviceCompany()->first() ? link_to_route('car_balance.service_company.show', $purchase_car->serviceCompany()->first()->name, array('id' => $purchase_car->serviceCompany()->first()->id), array()) : 'NULL' }}</td>

        <td>
            <a href="{{  route('car_balance.purchase_car.edit', $purchase_car->id) }}" class="btn btn-mini">Edit</a>
            @if ( ! is_null($purchase_car->deleted_at))
            <a href="{{  route('car_balance.purchase_car.restore', $purchase_car->id) }}" class="btn btn-mini btn-warning">Restore</a>
            @else
            <a href="{{  route('car_balance.purchase_car.delete', $purchase_car->id) }}" class="btn btn-mini btn-danger">Delete</a>
            @endif
        </td>
    </tr>
    @endforeach
    </tbody>
</table>

{{  $purchase_cars->links() }}

@stop